#include "stdint.h"
#include "stdio.h"
#include "FreeRTOS.h"
#include "task.h"
#include "time0.h"

void task0(void *arg)
{
    (void)arg;
    while (1)
    {
        printf("task0 run.\r\n");
        vTaskDelay(1000);
    }
}

void task1(void *arg)
{
    (void)arg;
    while (1)
    {
        printf("task1 run.\r\n");
        vTaskDelay(500);
    }
}

void tasks_example()
{
    TaskHandle_t Task0_handle, Task1_handle;
    (void)Task1_handle;
    xTaskCreate(task0, "task0", 1024, NULL, 1, &Task0_handle);
    xTaskCreate(task1, "task1", 1024, NULL, 2, &Task1_handle);
    printf("vTaskStartScheduler\r\n");
    vTaskStartScheduler();
    while (1)
    {
    }
}